package admin.server.dao;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import admin.dao.model.UmsAdmin;

public interface UmsAdminDao {
    @Select("select * from ums_admin where fei_shu_union_id = #{feiShuUnionId}  and logic_delete_at = 0")
    UmsAdmin queryByFeiShuUnionId(String feiShuUnionId);

    @Select("select * from ums_admin where fei_shu_union_id = #{feiShuUnionId} and phone = #{phone}  and logic_delete_at = 0")
    UmsAdmin queryByFeiShuUnionIdAndPhone(String feiShuUnionId, String phone);


    @Select("select * from ums_admin where phone = #{phone}  and logic_delete_at = 0 ")
    UmsAdmin queryByPhone(String phone);

    @Update("update ums_admin set fei_shu_union_id = #{unionId} ,fei_shu_open_id = #{openId}  where  phone = #{phone}  and logic_delete_at = 0")
    void bindingFeiShuQueryByPhone(String phone, String unionId, String openId);

    @Update("update ums_admin set logic_delete_at = UNIX_TIMESTAMP()   where  id = #{id}")
    void logicDelete(Long id);


}
